<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<link href="../css/dtree.css" rel="stylesheet" type="text/css" />
<style type="text/css">
 .searchtag {display: inline;}
 .searchtag dd {
    color: #5C5C5C;
    background:#FEF9DE;
    display: inline;
    float: left;
    white-space: nowrap;
    margin-left:10px;
    padding:1px;
}

.searchtag dd span {background: url("../images/sprite.png") no-repeat scroll -126px -30px transparent; 
    cursor: pointer;
    display: inline-block;
    height: 12px;
    overflow: hidden;
    position: relative;
    top: 2px;
    width: 13px;

    }
    
    
.searchtag {
    position: relative;
}
.searchtag dt {
    left: 15px;
    position: absolute;
    top: 10px;
}
#keyword_list_div {}
#keyword_list_div span {color: #5C5C5C; background:#FEF9DE;height:22px;display: inline-block;margin:2px;padding:2px;min-width: 80px;text-align: center;}
.content_main table td {text-align: left;}

</style>

</head>
<body>
<div id="all_main">
  <div class="head_main">
    <div class="main_nav">广告订单->订单创建</div>
    <div class="main_soso">
    	
    </div>
    <div class="main_title">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <th width="100%" style="border-left:none;text-align: left;font-weight: normal;"><span style="color:#229BC1;font-weight: bold;">广告基本信息</span> -&gt;投放条件-&gt;投放媒体选择-&gt;完成 </th>
        </tr>
      </table>
    </div>
  </div>
  <div class="content_main">
    <form action="/campaign/su_campaign.shtml" name="form01">
    <input name="id" value="${campaign.adId}"  type="hidden"/>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="background_hegh01">
      <tr>
        <td width="15%" style="border-left:none" align="right">广告名称：</td>
        <td width="">${campaign.adName}
        </td>
      </tr>
      <tr>
      
        <td width="15%" style="border-left:none" align="right">开始日期：</td>
        <td width=""><fmt:formatDate value="${campaign.beginDate}" pattern="yyyy-MM-dd"/> 结束日期：<fmt:formatDate value="${campaign.endDate}" pattern="yyyy-MM-dd"/></td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">广告类型：</td>
        <td width=""><app:code_name code="${campaign.adCate}" ></app:code_name> </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">计费类型：</td>
        <td width="">
          <c:choose>
             <c:when test="${campaign.adType=='1'}">cpc</c:when>
             <c:when test="${campaign.adType=='0'}">cpm</c:when>
             <c:when test="${campaign.adType=='2'}">cpa</c:when>
          </c:choose>
        </td>
      </tr>
       <!-- 
      <tr>
        <td width="15%" style="border-left:none" align="right">广告预算：</td>
        <td width=""><input name="order.adMoney" value="" type="text" size="8" style="width:60px;" class="inputwidth01" id="textfield" onkeypress="util.justNum([46]);" /> 元</td>
      </tr>
        -->
      <tr>
        <td width="15%" style="border-left:none" align="right">广告备注：</td>
        <td width="">${campaign.adDesc} </td>
      </tr>
    </table>
    </form>
  </div>
  
    <div class="content_main">
    <form action="/campaign/su_campaign_two.shtml" name="form01">
    <input name="id" value="${campaign.adId}"  type="hidden"/>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="background_hegh01">
      <tr>
        <td width="15%" style="border-left:none" align="right">运营商：</td>
        <td width="">
                               所有:<input type="radio" name="campaign.operatorSet" disabled="disabled" value="1" <c:if test="${campaign.operatorSet!='0'}">checked="checked"</c:if> />&nbsp;&nbsp; 具体运营商:<input type="radio"  disabled="disabled"  name="campaign.operatorSet" value="0" <c:if test="${campaign.operatorSet=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;
            <c:forEach items="${operList}" var="o" varStatus="oi">
                 ${o.contsName}  <input type="checkbox" disabled="disabled" name="opers" <c:if test="${oi.first}">checked="checked"</c:if>  value="${o.code}"/>&nbsp;&nbsp;
            </c:forEach>
        </span>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">地区：</td>
        <td width="">
                                所有地区:<input type="radio" name="campaign.areaSet" value="1" disabled="disabled"  <c:if test="${campaign.areaSet!='0'}">checked="checked"</c:if> />&nbsp;&nbsp; 具体地区:<input type="radio" name="campaign.areaSet" value="0" <c:if test="${campaign.areaSet=='0'}">checked="checked"</c:if> />&nbsp;&nbsp;
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">&nbsp;</td>
        <td width="">
        <div id="keyword_list_div">
	          <c:forEach items="${areaList}" var="o" varStatus="oi">
	                <span>${o.chnName}  <input type="checkbox" name="areas" disabled="disabled"  value="${o.id}"/>&nbsp;&nbsp;</span>
	            </c:forEach>
	           </div>
        </span>
        </td>
      </tr>

    </table>
    </form>
  </div>
  
  <c:if test="${!empty content}">
	  <div class="content_main">
	    <form action="/campaign/su_campaign_three.shtml" name="form01" method="post" enctype="multipart/form-data">
	    <input name="id" value="${campaign.adId}"  type="hidden"/>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="background_hegh01">
	      <tr>
	        <td width="15%" style="border-left:none" align="right">素材类型：</td>
	        <td width="">
	          <c:if test="${content.displayType!='it' && content.displayType!='t'}" >图片</c:if>
	          <c:if test="${content.displayType=='it'}" >图片加文字 </c:if>
	          <c:if test="${content.displayType=='t'}" >文字 </c:if>
	        </td>
	      </tr>
	      <tr>
	        <td width="15%" style="border-left:none" align="right">显示类型：</td>
	        <td width="">
	              <c:choose>
	                 <c:when test="${content.viewType=='p'}">notification push</c:when>
	                 <c:when test="${content.viewType=='b'}">bannel</c:when>
	                 <c:when test="${content.viewType=='w'}">ad wall</c:when>
	                 <c:when test="${content.viewType=='f'}">全屏</c:when>
	              </c:choose>
	        </td>
	      </tr>
	      <tr>
	        <td width="15%" style="border-left:none" align="right">点击类型：</td>
	        <td width="">
		        <c:if test="${content.clickType!='d'}">点击下载</c:if>
		        <c:if test="${content.clickType=='w'}">打开页面 </c:if>
	        </td>
	      </tr>
	      <c:if test="${!empty content.imgPath}">
		      <tr>
		        <td width="15%" style="border-left:none" align="right">广告图片：</td>
		        <td width="">
		        <app:image src="${content.imgPath}"></app:image></td>
		      </tr>
	      </c:if>
	      <tr>
	        <td width="15%" style="border-left:none" align="right">广告title：</td>
	        <td width="">${content.adTitle}</td>
	      </tr>
	      <tr>
	        <td width="15%" style="border-left:none" align="right">广告文字：</td>
	        <td width="">${content.adText}
	        </td>
	      </tr>
	      <tr>
	        <td width="15%" style="border-left:none" align="right">广告连接：</td>
	        <td width="">${content.adUrl}</td>
	      </tr>
	      <tr>
	        <td width="15%" style="border-left:none" align="right">广告包名：</td>
	        <td width="">${content.packName}</td>
	      </tr>
	    </table>
	    </form>
	  </div>
 </c:if>
  
  <div class="lapel" style="background:#FFFFFF;"><span><input name="" type="button" class="input01" value="下一步" onclick="validate.submit();"/></span></div>
</div>

<div id="boxId" style="position: absolute;background: red;display:none;"><span style="color:#fff;">正在加载...</span></div>

</body>
</html>
<script type="text/javascript" src="/scripts/calendar.js"></script>
<script type="text/javascript" src="/scripts/util.js"></script>
<script type="text/javascript" src="/scripts/xhr.js"/></script>
<script type="text/javascript" src="/scripts/form_validate.js"></script>
<script type="text/javascript">

var adId="${campaign.adId}";

function ck(){
	if(adId.length>0){
		util.dusk_div("boxId");
         function callback(d){
            util.close_dusk("boxId");
            var o = eval("("+d+")");
            checkDo("opers",o.operReg||"");
            checkDo("areas",o.areaReg||"");
         }
         new xhr("/campaign/check_campaign_two.shtml",callback).setParameter("id",adId).execute();
	}
}
  function checkDo(name,reg){
     var r = document.getElementsByName(name);
     var regxp = new RegExp("^("+reg+")$");
     util.each(r,function(e){
        e.checked = regxp.test(e.value);
     })
  }
  ck();
</script>
